<!-- 忘记密码 -->
      <?php 
        if (!empty($_GET['mail'])) {
          $class=$_GET['class'];
            $className="";
            switch ($class) {
              case 1:
              $className="administrations";
                break;
              case 2:
              $className="teachers";
               break;
              case 3:
              $className="students";
                break;
              default:
                
                break;
            }
          $queryMail="select name,password from ".$className." where email='".$_GET['mail']."'";
          $resultMail=$mysql->query($queryMail);
          if ($resultMail) {
            $rowMail=$resultMail->fetch_assoc();
            $mail = new SaeMail();
            //$mail->setAttach( array( 'my_photo' => '照片的二进制数据' ) );
            $MailContent=   $rowMail['name'].'您好：您的账户密码为：'.$rowMail['password'] ;
            
            $ret = $mail->quickSend( $_GET['mail'] , '【教务管理系统】找回密码' ,$MailContent, 'wughjjhcgjjulighjdhjkkknyi@jkk126.com' , 'l#gh19hg' );

            //发送失败时输出错误码和错误信息
            if ($ret === false)
                 echo "<script>alert('发送失败，请重试！');</script>";
              else
                  echo "<script>alert('密码已发送到您的邮箱,请注意查收！');</script>";
          }else{
            echo "<script>alert('请确定邮箱填写正确，请重试！');</script>";
          }
        }
         ?>
      <form class="form-inline" action="./signin.php" method="get">
        <div class="form-group">
          <select class="form-control" name="class">
          <option value="1">教务管理人员</option>
          <option value="2">教师</option>
          <option value="3">学生</option>
          </select>
        </div>
        <div class="form-group">
          <input type="email" name="mail" class="form-control" id="exampleInputEmail2" placeholder="输入接收密码的邮箱">
        </div>
        <button type="submit" class="btn btn-default">忘记密码</button>
      </form>